﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Globalization;

/// <summary>
/// Summary description for ConvertKeyFigure
/// </summary>
public class ConvertKeyFigureDigit
{
	public ConvertKeyFigureDigit()
	{
		//
		// TODO: Add constructor logic here
		//
	}

  public static string Convert(string value, string keyfigureName)
  {
    switch (keyfigureName)
    {
      case "return_on_equity":
      case "roi":
      case "equity_ratio":
      case "gross_margin_ratio":
      case "operating_margin":
      case "dividend_pr_stock_price":
        return String.Format(CultureInfo.GetCultureInfo("da-dk"), "{0:#0.# %}", Double.Parse(value));
      case "dividend_pr_share":
        return String.Format(CultureInfo.GetCultureInfo("da-dk"), "{0:#,0}", Double.Parse(value));
      default:
        return String.Format(CultureInfo.GetCultureInfo("da-dk"), "{0:#,0.##}", Double.Parse(value));
    }
  }
}